$(function(){
//values数据格式：[{bookMarkId:'',bookMarkName:'',id:'',value:'',type:''}]{bookMarkId:'',bookMarkName:'',id:'',value:'',type:''}][{bookMarkId:'',bookMarkName:'',id:'',value:'',type:''}][][][]....
function settingBookMarksValues(values){
	TANGER_OCX_OBJ = document.all.item("TANGER_OCX");
	$.each(values,function(i,bookMark){
		var _bookMarkId = bookMark.bookMarkId;
		var _bookMarkName = bookMark.bookMarkName;
		var _id = bookMark.id;
		var _value = bookMark.value;
		var _type = bookMark.type;
		if (TANGER_OCX_OBJ.ActiveDocument.Bookmarks.Exists(_bookMarkId)) {
			var __bookMarkRange = TANGER_OCX_OBJ.ActiveDocument.BookMarks(_bookMarkId).Range;
			if(_type === "署名型"){
				
			}else{
				
			}
			__bookMarkRange.Text = $.trim(_value);
			TANGER_OCX_OBJ.ActiveDocument.Bookmarks.Add(_bookMarkId, __bookMarkRange);
		}else{
			alert("不存在书签："+_bookMarkName+"("+_bookMarkId+")，无法进行域值同步。");	
		}
	});
}

$("#asynValues").click(function(){
		var _htbh = window.opener.document.forms[0].htbh.value;
		var _scbh = window.opener.document.forms[0].scbh.value;
		var _asynvalues = new Array();
		_asynvalues.push({
						 bookMarkId:'contract_asyn_htbh',
						 bookMarkName:'合同编号',
						 id:'htbh',
						 value:_htbh,
						 type:''});
		_asynvalues.push({
						 bookMarkId:'contract_asyn_scbh',
						 bookMarkName:'审查编号',
						 id:'scbh',
						 value:_scbh,
						 type:''});
		settingBookMarksValues(_asynvalues);
	});
		   });